< previous page page_500 next page >

Page 500
EXERCISE
Add Some Stubs for Routines You Need to Write
1. Go ahead and add each of the procedure names shown in the Form_Load() event to the form:
Private Sub StateLoad()

End Sub
Private Sub HealthCareLoad()

End Sub
Private Sub ListLoad()

End Sub
analysis.gifThese stubs of routines will be programmed to load each of the normal controls.

Now that youve added the stubs to this form, youll learn how to load up the main list box with employee names.
Loading the List Box
The ListLoad() procedure is a general form procedure that loads all the employee names from the tblEmployees table into the list box. The source code is shown here:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub ListLoad()
   Dim oRS As Recordset
   Dim strSQL As String

   strSQL = "SELECT lEmp_id, "
   strSQL = strSQL & "szLast_nm, "
   strSQL = strSQL & "sFirst_nm "
   strSQL = strSQL & "FROM tblEmployees "

   Set oRS = New Recordset
   oRS.Open strSQL, goConn, _
            adOpenForwardOnly, _
            adLockReadOnly

 
< previous page page_500 next page >

If you like this book, buy it!